/**
 * 
 */
package com.bestbuy.serviceimple;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.bestbuy.dao.CatalogDao;
import com.bestbuy.pojo.Catalog;
import com.bestbuy.service.CatalogService;

/**
 * @author ThanhNgo
 *
 */
@Service
public class CatalogServiceImpl implements CatalogService {
	
	@Autowired
	private CatalogDao catalogDAO;

	@Transactional
	public List<Catalog> getListCatalog() {
		// TODO Auto-generated method stub
		return catalogDAO.getListCatalog();
	}

	@Transactional
	public Catalog getCatalogByCatalogID(String catalogid) {
		// TODO Auto-generated method stub
		return catalogDAO.getCatalogByCatalogID(catalogid);
	}

	/* (non-Javadoc)
	 * @see com.bestbuy.service.CatalogService#addCatalog(com.bestbuy.pojo.Catalog)
	 */
	@Transactional
	public void addCatalog(Catalog catalog) {
		// TODO Auto-generated method stub
		catalogDAO.addCatalog(catalog);
	}

	/* (non-Javadoc)
	 * @see com.bestbuy.service.CatalogService#countCatalog()
	 */
	@Transactional
	public int countCatalog() {
		// TODO Auto-generated method stub
		return catalogDAO.countCatalog();
	}

	/* (non-Javadoc)
	 * @see com.bestbuy.service.CatalogService#getListCatalog(java.lang.String)
	 */
	@Transactional
	public List<Catalog> getListCatalog(String page) {
		// TODO Auto-generated method stub
		return catalogDAO.getListCatalog(page);
	}

	/* (non-Javadoc)
	 * @see com.bestbuy.service.CatalogService#updateCatalog(com.bestbuy.pojo.Catalog)
	 */
	@Transactional
	public void updateCatalog(Catalog catalog) {
		// TODO Auto-generated method stub
		catalogDAO.updateCatalog(catalog);
	}

	/* (non-Javadoc)
	 * @see com.bestbuy.service.CatalogService#deleteCatalog(com.bestbuy.pojo.Catalog)
	 */
	@Transactional
	public void deleteCatalog(Catalog catalog) {
		// TODO Auto-generated method stub
		catalogDAO.deleteCatalog(catalog);
	}

	/* (non-Javadoc)
	 * @see com.bestbuy.service.CatalogService#getListCatalogByDeleted(java.lang.String)
	 */
	@Transactional
	public List<Catalog> getListCatalogByDeleted(String isDeleted) {
		// TODO Auto-generated method stub
		return catalogDAO.getListCatalogByDeleted(isDeleted);
	}

	/* (non-Javadoc)
	 * @see com.bestbuy.service.CatalogService#countCatalog(java.lang.String)
	 */
	@Transactional
	public int countCatalog(String isDeleted) {
		// TODO Auto-generated method stub
		return catalogDAO.countCatalog(isDeleted);
	}

	/* (non-Javadoc)
	 * @see com.bestbuy.service.CatalogService#getListCatalog(java.lang.String, java.lang.String)
	 */
	@Transactional
	public List<Catalog> getListCatalog(String page, String isDeleted) {
		// TODO Auto-generated method stub
		return catalogDAO.getListCatalog(page, isDeleted);
	}

}
